/// ITT of daily rate on purchases

********************************************************************************
*** Get data
use "data/pseudodata/userlevel_pseudodata.dta", clear

keep if daily == 1
replace bound = 100 if bound == 1

********************************************************************************
*** binscatters

reg bound dayrate bundle basedayrate, r
local b: di %6.3gc r(table)[1,1]
local se: di %6.4gc r(table)[2,1]
di `b'
local b_neg = string(`b', "%9.2f")
local se_neg = string(`se', "%9.2f")
binscatter bound dayrate, controls(bundle basedayrate) ///
	xtitle("Daily premium") ytitle("") ///
	subtitle("Take-up (%)", pos(11) span) ///
	note("Slope: `b_neg'" "(`se_neg')", pos(2) ring(0) size(medium))
graph save one, replace
reg totdayscoverage90 dayrate bundle basedayrate, r
local b: di %6.3gc r(table)[1,1]
local se: di %6.4gc r(table)[2,1]
local b_neg = string(`b', "%9.2f")
local se_neg = string(`se', "%9.2f")

binscatter totdayscoverage90 dayrate, controls(bundle basedayrate) ///
	xtitle("Daily premium") ytitle("") ///
	subtitle("Days insured", pos(11) span) ///
	note("Slope: `b_neg'" "(`se_neg')", pos(2) ring(0) size(medium))
graph save two, replace
graph combine one.gph two.gph, cols(2) xcommon ysize(45) xsize(100) iscale(1.3) imargin(small)
graph export "output/figures/ITT dayrate plots.pdf", replace
erase one.gph
erase two.gph

